import './App.css';
import React from 'react'
import { useSelector } from 'react-redux'
import { dispatch} from './redux/store'
import msgListtSlice from './redux/msgListSlice'
import addSlice from './redux/addSlice'



function App() {

    console.log("redux里msgList的值：",useSelector(state => state.msgListttt.data))
    console.log("redux里add的值：",useSelector(state => state.zth.data))


    const handleMsg = () => {
        dispatch(msgListtSlice.actions.addMsg("看我吊不"))
    }
    const handleAdd = () => {
        dispatch(addSlice.actions.addData("不看"))
    }
    return (
        <div className="App">
                   <div >
                       msg in redux：{useSelector(state => state.msgListttt.data)}
                       <br></br>
                       add in redux：{useSelector(state => state.zth.data)}

                   </div>
            <button onClick={handleMsg}>点我改变msg里的值</button>
            <br></br>
            <button onClick={handleAdd}>点我改变add里的值</button>
        </div>
    );
}

export default App;


